package com.css.bjdt_report.executive.factory;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.css.bjdt_report.executive.report.ReportRequest;
import com.css.bjdt_report.executive.report.ReportSession;

public class ReportSessionFactory {
	
	private static ConcurrentMap<String,ReportSession> registry = new ConcurrentHashMap<String,ReportSession>(); 

	public static ReportSession create(ReportRequest request){
		String requestId = request.getRequestId();
		if(!registry.containsKey(requestId)){
			registry.put(requestId, new ReportSession());
		}
		return registry.get(requestId);
	}
}
